﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link rel="stylesheet" type="text/css" href="css/styles.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/tools.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<script type="text/javascript" src="js/jquery.corner.js"></script>
<style type="text/css">
	li:hover{
		background-color: pink;
		color: white;
		cursor: pointer;
	}
</style>
<script type="text/javascript">
	$(function() {
		$("#upBtn").click(function() {
			if ($("#upBtn").attr("name") < 0) {
				alert("已经是第一页了!");
			} else {
				location.href = "findProductAction?beginIndex=" + $("#upBtn").attr("name");
			}
		});
		$("#downBtn").click(function() {
			if ($("#downBtn").attr("name") >= ($("#maxPage").val())) {
				alert("已经是最后页了!");
			} else {
				location.href = "findProductAction?beginIndex=" + $("#downBtn").attr("name");
			}
		});
	});
</script>
</head>


<body>
	<s:if test="#request.loginError!=null">
		<script>
			alert("登陆失败!");
		</script>
	</s:if>
	<s:if test="#request.loginSuccess!=null">
		<script>
			alert("登陆成功!");
		</script>
	</s:if>
	<div align="center">
		<div align="center" style="height: 155px;">
			<div id="top" style="width:950px;">
				<img src="images/logo.jpg" width="950" height="150" border="0" />
			</div>
		</div>
		<div style="width: 950px;" id="home">
			<div align="left" style="background-color: pink;width: 950px;height: 32px;float: left;padding-top: 5px;">
				<font color="white" style="font-family: SimHei;font-size: 26px;">&nbsp;产品展示</font>&nbsp;&nbsp;&nbsp;&nbsp; 
				<font color="#ccc" style="font-family: SimHei;"><a href="findCaseAction" style="position: relative;width:100px;height:20px; border: 1px solid white;padding: 5px 10px 5px 10px;top:-5px;text-decoration: none;">案例展示</a> </font>&nbsp;&nbsp;&nbsp;&nbsp;
				<font color="#ccc" style="font-family: SimHei;"><a href="findByJingjieBlogAction" style="position: relative;width:100px;height:20px; border: 1px solid white;padding: 5px 10px 5px 10px;top:-5px;text-decoration: none;">静姐博客</a>
				</font>&nbsp;&nbsp;&nbsp;&nbsp;
				<s:if test="#session.ui!=null">
					<font color="#ccc" style="font-family: SimHei;font-size: 14px;"><a href="addPro.jsp" style="float: right;position: relative;top:2px;width:80px;height:20px; border: 1px solid white;left: -4px;">添加产品</a></font>
				</s:if>
			</div>
			
			<br/>
			<div style="width: 100%;height: 30px;float: left;"></div>
			<s:if test="lp!=null">
			<ul style="width:950px;">
				<s:iterator value="lp">
					
						<li style="list-style: none;float: left;width:195px;height: 270px;" onclick="location.href='getProByIdAction?produceId=<s:property value='produceId'/>'">
							<img src="getImagesAction?produceId=<s:property value='produceId'/>" width="190px" height="190px" style="border: 1px solid #ccc;"/>
							<span style="font-size: 15px;color: red;">
								<s:property value="produceName" />
							</span>&nbsp;&nbsp;&nbsp; 
							<span style="font-size: 15px;color:#FF9900;font-weight:700;">
								<s:property value="producePrice" />元</span><br />
							<span style="font-size: 15px;color:#666">
								<s:property value="%{produceNote.substring(0,20)}" />···
							</span><br/>
							<s:if test="#session.ui!=null">
								<a href="delProAction?produceId=<s:property value='produceId'/>">删除</a>
							</s:if>
						</li>
					<div style="width:30px;height:200px;float:left;"></div>
				</s:iterator>
				</ul>
				<div style="float: left;width:100%;" align="center">
					<div style="width:200px;" align="center">
						<a id="upBtn" name="<s:property value='beginIndex-16'/>" style="position:absolute; width:100px;height:20px; border: 1px solid #666;">◀上一页</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<a id="downBtn" name="<s:property value='beginIndex+16'/>" style="position:absolute; width:100px;height:20px; border: 1px solid #666;">下一页▶</a>
						<input type="hidden" id="maxPage" value="<s:property value='maxPage'/>" />
					</div>
				</div>
			</s:if>
			</div>
		</div>
	<hr width="100%" style="color:#ccc;float: left;position: relative;top:20px;" />
	<br />
	<div align="center" style="width: 100%;float: left;position: relative;top: 20px;">
		<a href="#" style="text-decoration:none;color:#666;font-size: 14px;">联系我们</a>&nbsp;&nbsp;|&nbsp;&nbsp;
		<a href="#" style="text-decoration:none;color:#666;font-size: 14px;">加入我们</a>&nbsp;&nbsp;|&nbsp;&nbsp;
		<s:if test="#session.ui!=null">
			<a href="exitAction"
				style="text-decoration:none;color:#666;font-size: 14px;">【退出】</a>
		</s:if>
		<s:else>
			<a href="javascript:showBox('登录','login()')"
				style="text-decoration:none;color:#666;font-size: 14px;">管理员入口</a>
		</s:else>
		<br /> <br /> <br />
	</div>
</body>
</html>